<?php


namespace frontend\controllers;
use Yii;
use yii\web\Controller;

class BaseController extends Controller
{
    /*
     * 控制器基类  判断是否登录*/
   public function __construct($id, $module, $config = [])
   {
       parent::__construct($id, $module, $config);

       if (Yii::$app->user->getIsGuest()) {
           return $this->goHome();
       }
   }

}